// 所有和【优惠券】相关的请求

import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/http"

export type CouponItemType = {
    _id: string;
    name: string;
    price: string;
    sendWayId: string;
    use_sill: number;
    min_price: string;
}

// 获取优惠券数据
export const findCouponApi = (data?: object) => {
    return httpPost('/coupon/find', data)
}
// 添加优惠券数据
export const addCouponApi = (data: object) => {
    return httpPost('/coupon/add', data)
}
// 删除优惠券数据
export const deleteCouponApi = (data: object) => {
    return httpDelete('/coupon/remove', data)
}
// 修改优惠券数据
export const updateCouponApi = (data: object) => {
    return httpPut('/coupon/update', data)
}
// 获取一个优惠券数据的详情
export const getCouponByIdApi = (data: object) => {
    return httpGet('/coupon/getById', data)
}

// 获取优惠券的发送方式
export const findCouponSendWayApi = (data?: object) => {
    return httpPost('/couponSendWay/find', data)
}